<?php
namespace app\common\model;

class Kf extends App
{
   // public $parentModel = 'Kfgl';
    /**
    * 关联模型
    */
    public $assoc = [
        'Kfgl' => [
            'type' => 'belongsTo'
        ],
        'Tasktgroup' => [
            'type' => 'belongsTo'
        ],
    ];
    
    public function initialize()
    {        
        $this->form = [
            'id' => [
            	'type' => 'integer',
            	'name' => 'ID',
            	'elem' => 'hidden',
            ],
            'kfname' => [
                'type' => 'string',
                'name' => '客服名称',
                'elem' => 'text',
            ],
            'kfgl_id' => [
                'type' => 'integer',
                'name' => '消息转发对像',
                'elem' => 'assoc_select',
                'list' => 'assoc',
                'foreign' => 'Kfgl.name'
            ],
            'tasktgroup_id' => [
                'type' => 'integer',
                'name' => '任务分组',
                'elem' => 'assoc_select',
                'list' => 'assoc',
                'foreign' => 'Tasktgroup.taskgroupname'
            ],
            'strattime' => [
                'type' => 'string',
                'name' => '转发开始时间',
                'elem' => 'text',
                'list' => 'edit'
            ],
            'stoptime' => [
                'type' => 'string',
                'name' => '转发结束时间',
                'elem' => 'text',
                'list' => 'edit'
            ],
            //其他字段
        ];
        call_user_func_array(['parent', __FUNCTION__], func_get_args());
    }
    
    /**
    // 表单分组
    public $formGroup = [
        'advanced' => '高级选项'
    ];
    */
    
    /**
    * 数据验证 
    */
    protected $validate = [];
}
